﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EFFC.Net.Data.Base;
using EFFC.Net.Data.DBData;

namespace EFFC.Net.Returns
{
    [Serializable]
    public class QueryByPageReturn : ReturnStd
    {
        public QueryByPageReturn()
        {
            AddReElement("DataTable", typeof(DataTableStd));
            AddReElement("TotalCount", typeof(int));
            AddReElement("CurrentPage", typeof(int));
            AddReElement("TotalPage", typeof(int));
        }

        /// <summary>
        /// 要返回的结果集
        /// </summary>
        public DataTableStd DataResult
        {
            get
            {
                return GetValue<DataTableStd>("DataTable");
            }
            set
            {
                _p["DataTable"].Value = value;
            }
        }
        /// <summary>
        /// 总资料笔数
        /// </summary>
        public int TotalCount
        {
            get
            {
                return GetValue<int>("TotalCount");
            }
            set
            {
                _p["TotalCount"].Value = value;
            }
        }
        /// <summary>
        /// 翻页之后的当前页
        /// </summary>
        public int CurrentPage
        {
            get
            {
                return GetValue<int>("CurrentPage");
            }
            set
            {
                _p["CurrentPage"].Value = value;
            }
        }
        /// <summary>
        /// 总页数
        /// </summary>
        public int TotalPage
        {
            get
            {
                return GetValue<int>("TotalPage");
            }
            set
            {
                _p["TotalPage"].Value = value;
            }
        }
    }

}
